<template>
  <div class="evection">
    <NavBar title="计划列表" right-text="新增" @click-right="onClickRight" />
    <Records :key="Math.floor(Math.random() * 10000) + 1" ref="RecordsRef" @callback="callbackRecords" />
    <!-- 选择模板 -->
    <!--<VanDialog v-model:show="showTele" :showConfirmButton="false">
      <div class="tele">
        <div class="title">请选择出差模板</div>
        <div class="jp">
          <Button class="btn" size="small" type="primary" @click="setDeptName(0)">军品事业部</Button>
        </div>
        <div class="jp">
          <Button class="btn" size="small" type="success" @click="setDeptName(1)">贸易事业部</Button>
        </div>
      </div>
    </VanDialog>-->
  </div>
</template>

<script setup name="evection">
import { ref } from "vue";
import { NavBar, Dialog, Button } from "vant";
import Records from "./components/records.vue";
import { useRouter } from "vue-router";
const router = useRouter();

const VanDialog = Dialog.Component;

// 打开弹出层
// 选择军品 还是贸易
const showTele = ref(false);
const type = ref(0);
const setDeptName = (e) => {
  type.value = e;
  router.push({
    path: "/apply",
    query: {
      type: e,
    },
  });
};

// 打开新增弹窗
const onClickRight = () => {
  //showTele.value = true;
  // 默认就是军品crm的数据
  setDeptName(0);
};
</script>
<style>
@import "../../assets/styles/index.scss";
</style>
<style scoped lang="scss">
@import "./index.scss";
</style>
